﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Security;

namespace ArivisAccounts.Models
{
    public class EditRoleModel
    {
        [Display(Name = "Role Name")]
        public string Role { get; set; }

        [Display(Name="Users in Role")]
        public string[] UsersInRole { get; set; }

        public string[] AllUsers { get; set; }

        public static EditRoleModel Create(string roleName)
        {
            return new EditRoleModel
            {
                Role = roleName,
                UsersInRole = System.Web.Security.Roles.GetUsersInRole(roleName)
            };
        }
    }
}